package com.huobao.yunying.adapters;

import java.util.List;

import com.huobao.yunying.entity.DingdanGood_data;
import com.huobao.yunying.utils.ImageUtils;
import com.huobao.yunying.utils.SkipUtils;
import com.huobao.zhangying.R;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import joanzapata.android.BaseAdapterHelper;
import joanzapata.android.QuickAdapter;

public class Adapter_dingdan_manager_Item extends QuickAdapter<DingdanGood_data> {

	public Adapter_dingdan_manager_Item(Context context, List<DingdanGood_data> data) {
		super(context, R.layout.item_dingdan_manager_item, data);
	}

	@Override
	protected void convert(BaseAdapterHelper arg0, final DingdanGood_data good_data) {
		ImageView imgView = arg0.getView(R.id.imgView);
		TextView tv_goods_name = arg0.getView(R.id.tv_goods_name);
		TextView tv_price = arg0.getView(R.id.tv_price);
		ImageUtils.loadimg(imgView, good_data.goods_image);
		tv_goods_name.setText(good_data.goods_name);
		tv_price.setText("价格：" + good_data.price + " 数量：" + good_data.quantity);
		imgView.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				SkipUtils.seeDetail(context, good_data.goods_id, good_data.goods_image);
			}
		});
	}

}
